package com.puff.jdbc.executor;

import com.puff.core.Puff;
import com.puff.jdbc.core.Context;
import com.puff.jdbc.core.SqlConfigParser;
import com.puff.jdbc.core.SqlStatementMapping;

public class XmlSql {

	public String sqlId;

	public Object parameter;

	public int page;

	public int size;

	protected String executorSql;

	protected Object[] executorArgs;

	protected void parser() {
		if (Puff.getDevMode()) {
			// 开发者模式，重新加载配置
			new SqlConfigParser().reload();
		}
		Context ctx = new Context();
		ctx.param = parameter;
		SqlStatementMapping.INSTANCE.get(sqlId).execute(ctx, null);
		this.executorSql = ctx.toString();
		this.executorArgs = ctx.getArgsArray();
	}

}
